Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
How can I return data from a MySQL query without it being [Object, object] and also, not a string via JSON.stringify?

I am getting the following results from SELECT query to a table in a MySQL db:

[
  RowDataPacket {
    id: 1,
    title: 'foo',
    date: 2012-07-06T08:40:14.000Z
  },
  RowDataPacket {
    id: 2,
    title: 'foo',
    date: 2021-12-16T16:00:12.000Z
  },
  RowDataPacket {
    id: 3,
    title: 'foo',
    date: 2012-07-06T08:40:14.000Z
  },
  RowDataPacket {
    id: 4,
    title: 'foo',
    date: 2019-12-02T14:13:41.000Z
  },
  RowDataPacket {
    id: 5,
    title: 'foo',
    date: 2019-11-25T12:46:25.000Z
  },
  RowDataPacket {
    id: 6,
    title: 'foo',
    date: 2021-12-17T16:00:12.000Z
  },
  RowDataPacket {
    id: 7,
    title: 'foo',
    date: 2021-12-15T16:00:12.000Z
  }
]

How can I return this within a response to an API call without it being returned as [object, object]?

I want to return it without it being a string as a string isn't that useable compared to JSON.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda